// 官网地址：http://ckang1229.gitee.io/vue-markdown-editor/zh/
import type { App } from 'vue'
// 轻灵级别
//import VMdEditor from '@kangc/v-md-editor';
//import '@kangc/v-md-editor/lib/style/base-editor.css';
// 重要级别
import VMdEditor from '@kangc/v-md-editor/lib/codemirror-editor';
import '@kangc/v-md-editor/lib/style/codemirror-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
VMdEditor.use(vuepressTheme);
//import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
//import '@kangc/v-md-editor/lib/theme/style/github.css';
// VMdEditor.use(githubTheme);
// codemirror 编辑器的相关资源
import Codemirror from 'codemirror';
// mode
import 'codemirror/mode/markdown/markdown';
// placeholder
import 'codemirror/addon/display/placeholder';
// active-line
import 'codemirror/addon/selection/active-line';
// scrollbar
import 'codemirror/addon/scroll/simplescrollbars';
import 'codemirror/addon/scroll/simplescrollbars.css';
// style
import 'codemirror/lib/codemirror.css';
VMdEditor.Codemirror = Codemirror;
// 插件的引入
// Emoji 表情插件
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index';
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css';
VMdEditor.use(createEmojiPlugin());
//Mermaid 插件（流程图等）
import createMermaidPlugin from '@kangc/v-md-editor/lib/plugins/mermaid/npm';
import '@kangc/v-md-editor/lib/plugins/mermaid/mermaid.css';
VMdEditor.use(createMermaidPlugin());
// LineNumber 代码行号
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
VMdEditor.use(createLineNumbertPlugin());
//Highlight Lines 高亮代码行
import createHighlightLinesPlugin from '@kangc/v-md-editor/lib/plugins/highlight-lines/index';
import '@kangc/v-md-editor/lib/plugins/highlight-lines/highlight-lines.css';
VMdEditor.use(createHighlightLinesPlugin());
//预览的插件
import VMdPreview from '@kangc/v-md-editor/lib/preview';
VMdPreview.use(vuepressTheme);

export function ElckerVMdEditor(app: App<Element>): void {
    app.use(VMdPreview)
    app.use(VMdEditor)
}
